Method of calculating broadband access server dhcp user&#39;s on-line time

ABSTRACT

A method of calculating broadband access server DHCP user&#39;s on-line time includes the steps of: (a) setting an inner time, an outer time and a flow threshold for said access server to count user&#39;s data flow, wherein the inner time is shorter than the outer time; (b) starting time charging to the users by instruction of the access server to the users sooner after the users access the access server and are authenticated successfully; (c) establishing a circular link list to each user for recording data flow of the user in the access server; (d) defining a number of elements in the circular link list as a multiple of the outer time to the inner time in the access server; (e) detecting the data flow of the user according to the inner time in the access server, and recording the data flow as a content of a head pointer of the circular link list in turn, until a difference between data flow newly detected and the content rerecorded in the head pointer is not more than the flow threshold.

FIELD OF THE INVENTION

The present invention generally relates to a method of time charging fora online user in a server in communication technology, and especiallyrelates to an improvement of a method time charging for a DHCP onlineuser in a broadband access server.

BACKGROUND OF THE INVENTION

With popularization of data services, there is little requirement ofnetwork knowledge for internet users. An access mode of DHCP+WEB+RADIUS,because of its user-friendly interface and no requirement ofsophisticated network knowledge for clients, is becoming a very popularnetwork mode provided by telecom service providers.

DHCP, an abbreviation of Dynamic Host Configuration Protocol, allows aserver to dynamically assign an IP address and relevant configurationinformation of the server to a client. For such a DHCP, each client canobtain an IP address at start and occupy the IP address thereafter, thusa DHCP access mode uses mass address resources of telecom serviceproviders. Furthermore, the DHCP access mode is unlike a narrowbandaccess mode that can supply a man-machine interface with a perfectconnection and disconnection mechanism. At present, no flat rate of feecharging based on client's online time is available in the market, andonly a monthly flat rate is used for the clients. On one hand, it wastesa lot of communication resources. On the other hand, with concerns onservice level and return on investment, service providers demandurgently technologies of accurate timing to realize the flat rate forDHCP users. When a DHCP user has been in an IDLE state for a period oftime, that is, when the user's communication data flow has been lowerthan an assigned value for a period of time, the user might beconsidered to be offline, and time charging for the user should bestopped. In other words, it needs to detect a user's IDLE state. Oncethe user is detected in the IDLE state, the user's connection with thenetwork should be disconnected, and meanwhile time charging of useronline should be ceased. Therefore, login timing accuracy to DHCP usersrelies on timeliness and accuracy of detecting the IDLE state.

Conventional detection methods of the IDLE state are in such way that atimer is directly configured such that data flow of a user is detectedperiodically at each interval so as to decide whether an incrementbetween the user's data flow and the last check point is less than athreshold (assigned value); if the increment is not greater than thethreshold, the user is considered offline; otherwise, the user isconsidered online or downloading.

The conventional technology, however, has the following defects:

1. Due to inaccuracy of fee charging methods, a user in an IDLE statemay be considered as in a normal online state.

For example, as shown in FIG. 1A, provided that a time interval for IDLEdetection is about 5 minutes, a user has a great deal flow at the firstminute, and the flow does not exceed a threshold, the user will beforced to login off at the tenth minute according to a conventionalalgorithm. Such detection error is certainly too large, and can alsomake a waste in communication resources. To solve the problem, the timeinterval of detection is usually reduced in conventional methods forIDLE state detection.

2. Due to fixed time intervals, the state of a user may wrongly bedetected.

For example, as shown in FIG. 1B, if the user's flow is relatively largeat the fourth and the sixth minute, but such a flow is not large enoughto exceed the threshold, the user will be forced to logoff at the tenthminute. In fact, the user's flow at an interval of five minutes exceedsthe threshold, and therefore the state of the user may wrongly bedetected. To solve the problem, testing time is usually increased inconventional methods for IDLE state detection so as to reduce frequencyof wrong detection. Thus it is difficult for conventional methods toachieve a desirable precision for time charging to DHCP users.

Therefore, a heretofore unaddressed need exists in the art to addressthe aforementioned deficiencies and inadequacies.

SUMMARY OF THE INVENTION

The technical problem solved in the present invention is to provide amethod of time charging to DHCP users in a broadband access server,which reduces detection error, solves the problem in detecting IDLEstate and satisfies the accuracy required.

In one aspect, the present invention provides a method of time chargingto DHCP online users in a broadband access server, wherein the broadbandaccess server detects data flow of an authenticated user by using aninner time interval that is shorter than an outer time interval and aflow threshold and establishing a circular linked list corresponding tothe user, and decides whether the user is in an IDLE state; if not, theserver records the present flow value in the circular link list andcontinually detects the data flow; otherwise the server determines theuser to be in an IDLE state. By reducing the time unit for data flowdetection, the detection error is reduced, the problem of detecting anIDLE state is solved, and the required precision is satisfied.

In one embodiment, the method comprises the following steps:

-   -   a) setting an inner time, an outer time and a flow threshold for        counting data flow of the users in the broadband access server,        the inner time being shorter than the outer time;    -   b) starting time charging to the users by instruction of the        access server to the users sooner after the users access the        access server and are authenticated successfully,    -   c) establishing a circular link list to each user for recording        data flow of the user in the access server;    -   d) defining a number of elements in the circular link list as a        multiple of the outer time to the inner time in the access        server; and    -   e) detecting the data flow of the user according to the inner        time in the access server, and recording the data flow as a        content of a head pointer of the circular link list in turn,        until a difference between data flow newly detected and the        content rerecorded in the head pointer is not more than the flow        threshold.

The method is characterized in that, when the circular link list is notfull, step e) further comprises the step of:

-   -   e1) examining data flow newly detected and the content of the        head pointer, when the difference between the data flow newly        detected and the content of the head pointer exceeds the flow        threshold, saving the data flow newly detected as the content of        the head pointer, and, meanwhile, moving the head and tail        pointers down a position.

The method is characterized in that, when the circular link list isfull, step e) further comprises the step of:

-   -   e2) examining data flow newly detected and the content of the        head pointer element, when the difference between the data flow        newly detected and the content of the head pointer exceeds the        flow threshold, saving the data flow newly detected as the        content of the head pointer, and moving the head and tail        pointers down a position.

The method is characterized in that the method further comprises thesteps of:

-   -   f) deciding the user in an IDLE state in the access server when        the difference between the data flow newly detected and the        content recorded in the head pointer does not exceed the flow        threshold; and    -   g) stopping time charging to the user by instruction of the        access server to the user.

The method is characterized in that the method further comprises thestep of setting the user in an unauthenticated state in step f).

The method is characterized in that the method further comprises thestep of setting a charging server for time charging to the online usersin step b).

The method is characterized in that the time for the charging server tostop time charging is before an outer time corresponding to the innertime when the IDLE state is detected.

The method is characterized in that the inner time is about 30 secondsand/or the outer time is about 5 minutes.

In one embodiment of the present invention, the access server defines acircular link list corresponding to a login user, regarding each elementin the circular link list, the content of the head pointer records dataflow that is detected in turn and when the assigned threshold isexceeded, and the tail pointer points to next element, so that data flowof the user can be monitored dynamically. In such a way, the timeprecision in detection is based on the inner time, and thereforedetection precision is enhanced and detection error is reduced.

The technical solution and its advantage effects of the presentinvention will be obvious through describing of the preferredembodiments of the present invention in details below in combinationwith drawings attached.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B are schematic diagrams of data flow detection of aconventional method.

FIG. 2 shows a flow chart of a method of time charging to DHCP onlineusers in broadband access server according to one embodiment of thepresent invention.

FIG. 3 is a flow chart of detection for each inner detection period in amethod according to one embodiment of the present invention.

FIG. 4 is a schematic diagram of data structure in a method according toone embodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

A method of time charging to DHCP online users in a broadband accessserver according to one embodiment of the present invention comprisesthe following steps:

Firstly, an outer time and an inner time are configured in a broadbandaccess server for detecting an IDLE state, which corresponds to a logoutstate of a user. In general, the broadband access server always monitorsuser flow, where a unit of an interval (inner time) for monitoring theuser flow in the broadband server is in seconds, and a unit of aninterval (outer time) for detecting an IDLE state at outside of thesystem is in minutes. According to one embodiment of the presentinvention, the interval for monitoring the user flow must be smallerthan a time interval for IDLE state detection outside. For example, anouter detection time may be set to be about 5 minutes, a threshold isabout 10 k, a time interval for detecting the user flow within thesystem, namely inner time, is about 30 seconds. Referring to FIG. 2, thetime charging method for DHCP users is further described as below.

At step 110: a user automatically obtains IP address by DHCP, isauthenticated successfully, and then accesses the Internet; and theaccess server timely informs a charging service to start time chargingto the user accessed.

At step 120: the time charging starts from the time when the user isauthenticated successfully. In general, passing through authenticationfor the user indicates that the user starts to accept service providedby the service provider.

At step 130: the broadband access server calculates a number of elementsin a circular link list based on the inner time and the outer timeconfigured. The number of elements equals to the ratio of the outer timeto the inner time. For example, in one embodiment, the inner time is setto be about 5 minutes and the outer time is set to be about 0.5 minutes.Accordingly, the number of elements of the circular link list is theratio of 5 to 0.5, that is 10. The broadband access server then recordsthe result calculated.

At step 140: the information on the user flow is timely updated.

At step 150: an IDLE state of the user is detected.

At step 160: the user in the IDLE state is forced to log out.

Referring to FIG. 3, the flow chart of detection for the circular linklist is shown according to one embodiment of the present invention. Thecircular link list corresponds to an accessed and authenticated user. Ina process of recording a corresponding user's data flow, a pointer isused to point a head pointer of the circular link list. The content ofan element of the head pointer is corresponding to the value of flowbefore an IDLE detection interval, and the content of an element pointedby a tail pointer is the latest flow result detected.

The user's circular link list is not full when the user just passes theauthentication. At first, whether the number of elements in the circularlink list is up to 10 or not is checked. If the number of elements isnot up to 10, an element is added at each interval of the inner time,the content of the head pointer is filled with data flow resultreported, the element newly added is added to the tail of the circularlink list, and the tail pointer points to the element new added.Particularly, each new data flow value is compared with the content ofthe head pointer in the circular link list, after compared, if the useris not in an IDLE state, such new data flow value is saved in thecontent of the head pointer. At the same time, the head and tailpointers move down one position, so as to ensure that the content of theelement of the head pointer still is flow value before one IDLEdetecting interval and the content of the element pointed by the tailpointer still is the latest data flow result detected.

If the circular link list is full (up to 10), new data flow valuedetected is compared with the value of the element of the head pointer;if the difference between the new data flow and the content of theelement of the head pointer is greater than the assigned threshold, 10 kfor example, the new data flow value overwrites the value of the headpointer, and meanwhile, the head and tail pointers move down oneposition, so as to ensure that the value of the element of the headpointer still is the flow value before one IDLE detecting interval andthe value of the element pointed by the tail pointer still is newly dataflow result detected.

If the difference between the new data flow and the content of theelement of the head pointer is not greater than the assigned threshold,10 k, the user is considered being offline; and then the broadbandaccess server sets the user in unauthenticated state, that is, the useris forced to logout. Meanwhile, the broadband access server informsRADIUS Server of the user being offline and stopping time charging. Thetime when the user logs out is considered as the time before 5 minutes.

In the embodiment, as shown in FIGS. 2 and 3, the broadband accessserver starts to query the user's data flow. Referring back to FIG. 3,detection for the circular link list includes the following steps: atstep 300, the number of elements in a corresponding circular link listis obtained by detecting the user's data flow. At step 310, the numberof elements is compared with those in the current circular link list.Then at step 320, whether a desirable number of elements is achieved isdetermined. If not, the detection result is filled to the content of thehead pointer and the tail pointer point is made to the new element,meanwhile, the head and tail pointers move down one position, and dataflow is detected for a next inner time at step 340. If the number ofelements in the circular link list is greater than the desirable number,the element of the tail pointer and the content of the head pointer arecompared at step 330. Then whether the difference between the element ofthe tail pointer and the content of the head pointer is greater than theassigned threshold is determined at step 350. If the difference isgreater than the assigned threshold, the head and tail pointers aremoved down one position, and the new data flow is filled to the contentof the head pointer at step 360. If the difference is not greater thanthe assigned threshold, the user is set to be in unauthenticated stateand forced to offline by the broadband access server at step 370. Thenthe system is returned to its detection state at step 380.

In one embodiment of the present invention, the detected results of thedata flow of the user in the latest period of time are saved in turn,which corresponds to a queue of the user's flow data observing through adata window in which the width of the data window is width of the innertime for detecting flow assigned for the user. In the data window,multiple detecting results are saved, and the interval of each result iscorresponding to the inner time for detecting flow in the system, asshown is FIG. 4.

According to the present invention, when the data flow of the user isqueried once, the data window goes forward one position. While moving,the flow results at the two ends of the window are compared; if thedifference between the flow results at the two ends of the window is notgreater than the threshold, the user is considered in an IDLE state andforced to be offline; otherwise, new data detected is filled into thecontent of the head pointer.

In conventional algorithms for realizing IDLE detection, in general, thegranularity of detection is an interval assigned for detecting, such as5 minutes. However, according to the method (algorithm) of the presentinvention, the detection granularity is the inner time for querying userdata flow in the system, such as 30 seconds, so the detection is moreaccurate.

It should be noted that the inner time and the outer time in the methodof the present invention could be assigned in different values. Thespecific value mentioned above is corresponding to one embodiment of thepresent invention, which should not be used to limit the scope of thepresent invention.

It should be noted that, persons skilled in the art should understandthat, the technical solutions of the present invention can be modifiedor substituted, without departing from the spirit and scope of thepresent invention, and all the modification and substitution fall in thescope of claims in the present invention.

1. A method of time charging to DHCP online users in a broadband accessserver, comprising the steps of: a) setting an inner time, an outer timeand a flow threshold for counting data flow of the users in thebroadband access server, the inner time being shorter than the outertime; b) starting time charging to the users by instruction of theaccess server to the users sooner after the users access the accessserver and are authenticated successfully, c) establishing a circularlink list to each user for recording data flow of the user in the accessserver; d) defining a number of elements in the circular link list as amultiple of the outer time to the inner time in the access server; ande) detecting the data flow of the user according to the inner time inthe access server, and recording the data flow as a content of a headpointer of the circular link list in turn, until a difference betweendata flow newly detected and the content rerecorded in the head pointeris not more than the flow threshold.
 2. The method of claim 1,characterized in that, when the circular link list is not full, step e)further comprises the step of: e1) examining data flow newly detectedand the content of the head pointer, when a difference between data flownewly detected and the content of the head pointer exceeds the flowthreshold, saving the data flow newly detected as the content of thehead pointer, and, meanwhile, moving the head and tail pointers down aposition.
 3. The method as claimed in claim 1, characterized in that,when the circular link list is full, step e) further comprises the stepof: e2) examining data flow newly detected and the content of the headpointer element, when a difference between data flow newly detected andthe content of the head pointer exceeds the flow threshold, saving thedata flow newly detected as the content of the head pointer, and movingthe head and tail pointers down a position.
 4. The method of claim 2,characterized in that the method further comprises the steps of: f)deciding the user in an IDLE state in the access server when thedifference between the data flow newly detected and the content recordedin the head pointer does not exceed the flow threshold; and g) stoppingtime charging to the user by instruction of the access server to theuser.
 5. The method of claim 4, characterized in that the method furthercomprises the step of setting the user in an unauthenticated state instep f).
 6. The method of claim 4, characterized in that the methodfurther comprises the step of setting a charging server for timecharging to the online users in step b).
 7. The method of claim 6,characterized in that the time for the charging server to stop timecharging is before an outer time corresponding to the inner time whenthe IDLE state is detected.
 8. The method of claim 5, characterized inthat the inner time is about 30 seconds and/or the outer time is about 5minutes.
 9. A method of time charging to DHCP online users in abroadband access server, characterized in that the method comprises thesteps of: detecting data flow of an authenticated user by using an innertime interval being shorter than an outer time interval and a flowthreshold in the broadband access server and establishing a circularlink list corresponding the user so as to decide whether the user is inan IDLE state; and if the user is not in the IDLE state, recordingcurrent data flow in the circular link list and continuedly detectingthe data flow; otherwise, determining the user in IDLE state.
 10. Themethod of claim 9, characterized in that the method further comprisesthe steps of: assigning an IP address through the broadband accessserver to a user and authenticating the user; starting time charging tothe user from the time when the user is authenticated successfully;calculating a number of elements in a circular link list according tothe inner time and the outer time configured; updating the informationof the user flow timely; detecting an IDLE state of the user; andforcing the user in IDLE state to log out.
 11. The method of claim 3,characterized in that the method further comprises the steps of: f)deciding the user in an IDLE state in the access server when thedifference between the data flow newly detected and the content recordedin the head pointer does not exceed the flow threshold; and g) stoppingtime charging to the user by instruction of the access server.
 12. Themethod of claim 5, characterized in that the method further comprisesthe step of setting a charging server for time charging to online usersin step b).